/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.F000;
import queenb.net.entitybean.F000;
import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class F000Store extends F000{
    
     public List<F000> getListCityALL(int pnFH000, int pnFH200, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement data = new DataStatement(PackageContants.LIST_F000, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });

        return super.find(data, F000.class);
    }

    
    public int updateF000(int pnPF000,int pnFH000, int pnFH200, String pvFV001, String pvFV002, int pnFN003, int pnFN004, String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.UPDATE_F000, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPF000),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, pvFV001),
                        new Param(OracleTypes.CHAR, pvFV002),
                        new Param(OracleTypes.INTEGER, pnFN003),
                        new Param(OracleTypes.INTEGER, pnFN004),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, F000.class);
        } catch (SQLException ex) {

            return 0;
        }

    }
    
    public List<F000> findAllF000ForCombo(int pnFH000, int pnFH200,String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.COMBO_F000, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(dataStatement, F000.class);
        } catch (SQLException ex) {
            Logger.getLogger(F000Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(F000Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(F000Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    
     public int deleteF000(int pnPF000, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.DELETE_F000, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPF000),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.update(dataStatement, F000.class);
        } catch (SQLException ex) {
            Logger.getLogger(F000Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
     
    

}
